import { http } from '@/utils/request'

// AI客服相关API
export const aiAPI = {
  // 智能客服问答
  customerService(question) {
    return http.post('/ai/customer-service/', {
      question: question
    })
  },

  // 获取知识库统计信息
  getKnowledgeStats() {
    return http.get('/ai/customer-service/')
  },

  // 获取聊天历史
  getChatHistory(userId, page = 1, pageSize = 20) {
    return http.get('/ai/chat/', {
      user_id: userId,
      page: page,
      page_size: pageSize
    })
  },

  // 清空聊天历史
  clearChatHistory(userId) {
    return http.delete('/ai/chat/', {
      user_id: userId
    })
  },

  // 获取知识库管理信息
  getKnowledgeBase() {
    return http.get('/ai/knowledge-base/')
  },

  // 获取数据分析
  getAnalytics() {
    return http.get('/ai/analytics/')
  }
} 